/**
 * 创建指定长度的数组
 */
export const createArray = (len: number) => new Array(len).fill("");

/**
 * 创建指定长度的数组
 */
export const getGroupByKey = (list: any[], key: string) => {
  const groupList: { key: string; list: any[] }[] = [];
  list.forEach((i) => {
    const group = groupList.find((j) => i[key] === j.key);
    group ? group.list.push(i) : groupList.push({ key: i[key], list: [i] });
  });
  return groupList;
};
